#ifndef IAPMINIMAL_H
#define IAPMINIMAL_H

#include <QObject>
#include <iapclient.h>

class IAPminimal : public QObject
{
    Q_OBJECT
public:
    explicit IAPminimal(QObject *parent = 0);
    ~IAPminimal();
    Q_INVOKABLE void getProductData();
    Q_INVOKABLE void purchaseProduct();
    Q_INVOKABLE void closeIAP();

signals:
    void productDataComplete(QString data);
    void productPurchaseComplete(QString data);
    void statusBusy();
    void iapClosed();

private slots:
    void productDataReceived(int requestId, QString status, IAPClient::ProductDataHash productData);
    void purchaseFlowFinished( int requestId );
    void purchaseCompleted( int requestId, QString status, QString purchaseTicket );

    void stopIAP();
    void startIAP();

private:
    // data
    IAPClient *iap_client;
    bool      isbusy;
};

#endif // IAPMINIMAL_H
